{% extends "file_manager/base.html" %}

{% block content %}
<div class="container mt-4">
    <h4>PDF预览: {{ file_name }}</h4>
    <div class="card">
        <div class="card-body">
            <div class="embed-responsive embed-responsive-16by9">
                {% if file_path and file_path|length > 0 %}
                    <iframe class="embed-responsive-item" 
                            src="{% url 'serve_pdf' file_path=file_path %}" 
                            style="width: 100%; height: 800px;">
                    </iframe>
                    <a href="{% url 'download' file_path=file_path %}" class="btn btn-sm btn-primary">下载</a>
                {% else %}
                    <p class="text-danger">PDF路径无效</p>
                {% endif %}
            </div>
        </div>
    </div>
</div>
{% endblock %}
